﻿using AutoRegistDependency.Attributes;
using HandyWpf.ViewModels.Base.Enum;
using System;
using System.Collections.Generic;
using System.Globalization;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows;
using System.Windows.Data;

namespace HandyWpf.Converters
{
    [Component]
    public class FormStatus2VisibilityConverter : IValueConverter
    {
        public object Convert(object value, Type targetType, object parameter, CultureInfo culture)
        {
            var vis = Visibility.Visible;
            if((value is FormStatus formStatus))
            {
                if((int)formStatus== System.Convert.ToInt32(parameter))
                {
                    vis = Visibility.Visible;
                }
                else
                {
                    vis = Visibility.Collapsed;
                }
            }
            return vis;
        }

        public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture)
        {
            throw new NotImplementedException();
        }
    }
}
